<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <div>首页</div>
  <div>添加一个新功能123</div>
  <script type="text/javascript">
    function sum (n) {
      var total = 0
      for (var i = 0; i <= n; i++) {
        total += i
      }
      console.log(total)
      return total
    }
  </script>
</body>
</html>